package com.gmail.blackdog1987.onedollar.dao;

import com.gmail.blackdog1987.onedollar.dao.hibernate.EntityHibernateDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.BaseJdbcDao;
import com.gmail.blackdog1987.onedollar.dao.hibernate.jdbc.JdbcUtil;
import com.gmail.blackdog1987.onedollar.entity.TSearchKeywordEntity;
import com.gmail.blackdog1987.onedollar.entity.TUserAddressEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("searchKeywordDao")
public class SearchKeywordDao extends EntityHibernateDao<TSearchKeywordEntity>{
    @Autowired
    private BaseJdbcDao baseJdbcDao;

    public List<TSearchKeywordEntity> query(){
        String selectionSql = " SELECT * FROM t_search_keyword ORDER BY id DESC";
        return JdbcUtil.queryForList(baseJdbcDao, TSearchKeywordEntity.class, selectionSql, new Object[]{});
    }
}
